<template>
  <div class="alabel-container">
    <!-- 页面标题和操作按钮 -->
    <div class="page-header">
      <div class="header-left">
        <h1>AI标注控制台</h1>
        <p>欢迎回来，这里是您的AI标注工作概览</p>
      </div>
      <div class="header-right">
        <button class="export-btn" @click="router.push('/Xiaozhi/ALabel/yanshi')">查看演示</button>
        <button class="export-btn">导出报告</button>
        <button class="create-btn">创建任务</button>
      </div>
    </div>

    <!-- 统计卡片区域 -->
    <div class="stat-cards">
      <div class="stat-card primary">
          <div class="stat-content">
            <div class="stat-number">128</div>
            <div class="stat-title">总任务数</div>
            <div class="stat-subtitle">本月新增标注任务</div>
          </div>
          <div class="stat-icon">📊</div>
        </div>
        <div class="stat-card warning">
          <div class="stat-content">
            <div class="stat-number">36</div>
            <div class="stat-title">待处理任务</div>
            <div class="stat-subtitle">今日待处理任务</div>
          </div>
          <div class="stat-icon">⚠️</div>
        </div>
        <div class="stat-card success">
          <div class="stat-content">
            <div class="stat-number">92</div>
            <div class="stat-title">已完成任务</div>
            <div class="stat-subtitle">本月已完成</div>
          </div>
          <div class="stat-icon">✅</div>
        </div>
        <div class="stat-card info">
          <div class="stat-content">
            <div class="stat-number">96.8%</div>
            <div class="stat-title">标注准确率</div>
            <div class="stat-subtitle">近30天平均</div>
          </div>
          <div class="stat-icon">🎯</div>
        </div>
    </div>

    <!-- 图表区域 -->
    <div class="charts-container">
      <div class="chart-card">
        <div class="chart-header">
          <h3>任务完成趋势</h3>
          <div class="chart-tabs">
            <span class="tab active">周</span>
            <span class="tab">月</span>
            <span class="tab">年</span>
          </div>
        </div>
        <div id="taskTrendChart" class="chart" ref="taskTrendRef"></div>
      </div>
      
      <div class="chart-card">
        <h3>任务类型分布</h3>
        <div id="taskTypeChart" class="chart" ref="taskTypeRef"></div>
      </div>
    </div>

    <!-- 最近标注任务表格 -->
    <div class="tasks-container">
      <div class="tasks-header">
        <h3>最近标注任务</h3>
        <button class="view-all-btn">查看全部</button>
      </div>
      <div class="tasks-table">
        <div class="table-header">
          <div class="header-cell" style="width: 25%">任务名称</div>
          <div class="header-cell" style="width: 15%">类型</div>
          <div class="header-cell" style="width: 20%">进度</div>
          <div class="header-cell" style="width: 15%">截止日期</div>
          <div class="header-cell" style="width: 10%">状态</div>
          <div class="header-cell" style="width: 15%">操作</div>
        </div>
        
        <!-- 任务列表 -->
        <div class="table-body">
          <!-- 任务1 -->
          <div class="table-row">
            <div class="table-cell" style="width: 25%">
              <div class="task-info">
                <div class="task-name">攀爬场景识别标注</div>
                <div class="task-id">Task-ID: 20230512</div>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">
              <span class="task-type target">目标检测</span>
            </div>
            <div class="table-cell" style="width: 20%">
              <div class="progress-container">
                <div class="progress-bar" style="width: 70%"></div>
                <span class="progress-text">70%</span>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">2023-05-20</div>
            <div class="table-cell" style="width: 10%">
              <span class="status in-progress">进行中</span>
            </div>
            <div class="table-cell" style="width: 15%">
              <button class="action-btn edit">继续</button>
              <button class="action-btn detail">详情</button>
            </div>
          </div>
          
          <!-- 任务2 -->
          <div class="table-row">
            <div class="table-cell" style="width: 25%">
              <div class="task-info">
                <div class="task-name">危险边缘靠近预警</div>
                <div class="task-id">Task-ID: 20230508</div>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">
              <span class="task-type image">图像分类</span>
            </div>
            <div class="table-cell" style="width: 20%">
              <div class="progress-container">
                <div class="progress-bar success" style="width: 100%"></div>
                <span class="progress-text">100%</span>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">2023-05-15</div>
            <div class="table-cell" style="width: 10%">
              <span class="status completed">已完成</span>
            </div>
            <div class="table-cell" style="width: 15%">
              <button class="action-btn review">查看</button>
              <button class="action-btn detail">详情</button>
            </div>
          </div>
          
          <!-- 任务3 -->
          <div class="table-row">
            <div class="table-cell" style="width: 25%">
              <div class="task-info">
                <div class="task-name">违规操作场景识别</div>
                <div class="task-id">Task-ID: 20230515</div>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">
              <span class="task-type semantic">语义分割</span>
            </div>
            <div class="table-cell" style="width: 20%">
              <div class="progress-container">
                <div class="progress-bar warning" style="width: 40%"></div>
                <span class="progress-text">40%</span>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">2023-05-25</div>
            <div class="table-cell" style="width: 10%">
              <span class="status in-progress">进行中</span>
            </div>
            <div class="table-cell" style="width: 15%">
              <button class="action-btn edit">继续</button>
              <button class="action-btn detail">详情</button>
            </div>
          </div>
          
          <!-- 任务4 -->
          <div class="table-row">
            <div class="table-cell" style="width: 25%">
              <div class="task-info">
                <div class="task-name">危险物品接触预警</div>
                <div class="task-id">Task-ID: 20230518</div>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">
              <span class="task-type instance">实例分割</span>
            </div>
            <div class="table-cell" style="width: 20%">
              <div class="progress-container">
                <div class="progress-bar danger" style="width: 10%"></div>
                <span class="progress-text">10%</span>
              </div>
            </div>
            <div class="table-cell" style="width: 15%">2023-06-05</div>
            <div class="table-cell" style="width: 10%">
              <span class="status in-progress">进行中</span>
            </div>
            <div class="table-cell" style="width: 15%">
              <button class="action-btn edit">继续</button>
              <button class="action-btn detail">详情</button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 底部功能卡片区域 -->
    <div class="feature-cards">
      <div class="feature-card">
        <div class="feature-icon create">
          <i class="el-icon-plus"></i>
        </div>
        <h4>创建新任务</h4>
        <p>快速创建新的标注任务，支持多种标注类型</p>
        <button class="feature-btn">立即创建 &gt;</button>
      </div>
      
      <div class="feature-card">
        <div class="feature-icon upload">
          <i class="el-icon-upload"></i>
        </div>
        <h4>上传数据集</h4>
        <p>上传待标注数据集，支持批量导入和格式转换</p>
        <button class="feature-btn">上传文件 &gt;</button>
      </div>
      
      <div class="feature-card">
        <div class="feature-icon settings">
          <i class="el-icon-setting"></i>
        </div>
        <h4>模型设置</h4>
        <p>配置AI辅助标注模型参数，提高标注效率</p>
        <button class="feature-btn">配置参数 &gt;</button>
      </div>
    </div>
  </div>
</template>

<script setup>
// Vue3 Composition API
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
import { useRouter } from 'vue-router'

// 路由实例
const router = useRouter()
import * as echarts from 'echarts'
// Element Plus 组件
import { ElButton } from 'element-plus'

// 图表引用
const taskTrendRef = ref(null)
const taskTypeRef = ref(null)
let taskTrendChart = null
let taskTypeChart = null

// 初始化任务完成趋势图
const initTaskTrendChart = () => {
  if (taskTrendRef.value) {
    taskTrendChart = echarts.init(taskTrendRef.value)
    const option = {
      tooltip: {
        trigger: 'axis',
        backgroundColor: 'rgba(255, 255, 255, 0.95)',
        borderColor: '#e2e8f0',
        borderWidth: 1,
        borderRadius: 8,
        textStyle: {
          color: '#374151'
        },
        transitionDuration: 0.3,
        padding: [10, 15],
        axisPointer: {
          type: 'line',
          lineStyle: {
            color: '#e5e7eb',
            width: 1
          },
          shadowBlur: 5,
          shadowColor: 'rgba(0, 0, 0, 0.05)'
        }
      },
      legend: {
        data: ['已完成', '进行中', '已编辑'],
        top: 10,
        textStyle: {
          color: '#6b7280',
          fontSize: 13
        },
        itemGap: 20,
        itemWidth: 12,
        itemHeight: 12
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
        axisLine: {
          lineStyle: {
            color: '#e5e7eb'
          }
        },
        axisLabel: {
          color: '#9ca3af',
          fontSize: 12
        },
        axisTick: {
          show: false
        }
      },
      yAxis: {
        type: 'value',
        axisLine: {
          show: false
        },
        splitLine: {
          lineStyle: {
            color: '#f3f4f6',
            type: 'dashed'
          }
        },
        axisLabel: {
          color: '#9ca3af',
          fontSize: 12
        },
        axisTick: {
          show: false
        }
      },
      series: [
        {
          name: '已完成',
          type: 'line',
          data: [18, 22, 28, 25, 30, 28, 32],
          smooth: true,
          smoothMonotone: 'x',
          lineStyle: {
            width: 2.5,
            color: '#409eff',
            shadowColor: 'rgba(64, 158, 255, 0.3)',
            shadowBlur: 6,
            shadowOffsetY: 2
          },
          itemStyle: {
            color: '#409eff',
            borderColor: '#ffffff',
            borderWidth: 2,
            shadowBlur: 4,
            shadowColor: 'rgba(64, 158, 255, 0.3)'
          },
          areaStyle: {
            opacity: 0.2,
            color: {
              type: 'linear',
              x: 0, y: 0,
              x2: 0, y2: 1,
              colorStops: [
                { offset: 0, color: 'rgba(64, 158, 255, 0.25)' },
                { offset: 1, color: 'rgba(64, 158, 255, 0.02)' }
              ]
            }
          },
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowColor: 'rgba(64, 158, 255, 0.5)',
              scale: 1.2
            }
          },
          animationDuration: 2000,
          animationEasing: 'cubicOut'
        },
        {
          name: '进行中',
          type: 'line',
          data: [8, 10, 12, 15, 12, 10, 8],
          smooth: true,
          smoothMonotone: 'x',
          lineStyle: {
            width: 2.5,
            color: '#e6a23c',
            shadowColor: 'rgba(230, 162, 60, 0.3)',
            shadowBlur: 6,
            shadowOffsetY: 2
          },
          itemStyle: {
            color: '#e6a23c',
            borderColor: '#ffffff',
            borderWidth: 2,
            shadowBlur: 4,
            shadowColor: 'rgba(230, 162, 60, 0.3)'
          },
          areaStyle: {
            opacity: 0.2,
            color: {
              type: 'linear',
              x: 0, y: 0,
              x2: 0, y2: 1,
              colorStops: [
                { offset: 0, color: 'rgba(230, 162, 60, 0.25)' },
                { offset: 1, color: 'rgba(230, 162, 60, 0.02)' }
              ]
            }
          },
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowColor: 'rgba(230, 162, 60, 0.5)',
              scale: 1.2
            }
          },
          animationDuration: 2000,
          animationDelay: 300,
          animationEasing: 'cubicOut'
        },
        {
          name: '已编辑',
          type: 'line',
          data: [5, 6, 8, 7, 9, 8, 10],
          smooth: true,
          smoothMonotone: 'x',
          lineStyle: {
            width: 2.5,
            color: '#67c23a',
            shadowColor: 'rgba(103, 194, 58, 0.3)',
            shadowBlur: 6,
            shadowOffsetY: 2
          },
          itemStyle: {
            color: '#67c23a',
            borderColor: '#ffffff',
            borderWidth: 2,
            shadowBlur: 4,
            shadowColor: 'rgba(103, 194, 58, 0.3)'
          },
          areaStyle: {
            opacity: 0.2,
            color: {
              type: 'linear',
              x: 0, y: 0,
              x2: 0, y2: 1,
              colorStops: [
                { offset: 0, color: 'rgba(103, 194, 58, 0.25)' },
                { offset: 1, color: 'rgba(103, 194, 58, 0.02)' }
              ]
            }
          },
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowColor: 'rgba(103, 194, 58, 0.5)',
              scale: 1.2
            }
          },
          animationDuration: 2000,
          animationDelay: 600,
          animationEasing: 'cubicOut'
        }
      ],
      animation: true,
      animationDuration: 2500,
      animationEasing: 'cubicOut',
      animationDelay: 200
    }
    taskTrendChart.setOption(option)
  }
}

// 初始化任务类型分布图
const initTaskTypeChart = () => {
  if (taskTypeRef.value) {
    taskTypeChart = echarts.init(taskTypeRef.value)
    const option = {
      tooltip: {
        trigger: 'item',
        backgroundColor: 'rgba(255, 255, 255, 0.95)',
        borderColor: '#e2e8f0',
        borderWidth: 1,
        borderRadius: 8,
        textStyle: {
          color: '#374151'
        },
        padding: [10, 15],
        formatter: '{b}: {c} ({d}%)'
      },
      legend: {
        orient: 'vertical',
        left: 'left',
        top: 'center',
        textStyle: {
          color: '#6b7280',
          fontSize: 13
        },
        itemGap: 15,
        itemWidth: 12,
        itemHeight: 12
      },
      series: [
        {
          name: '任务类型',
          type: 'pie',
          radius: ['50%', '70%'],
          center: ['60%', '50%'],
          avoidLabelOverlap: false,
          itemStyle: {
            borderRadius: 10,
            borderColor: '#ffffff',
            borderWidth: 3,
            shadowBlur: 0,
            shadowColor: 'rgba(0, 0, 0, 0.05)'
          },
          label: {
            show: false,
            position: 'center'
          },
          emphasis: {
            label: {
              show: true,
              fontSize: '16',
              fontWeight: '600',
              color: '#1f2937',
              formatter: function(params) {
                return params.name + '\n' + params.value + '项';
              }
            },
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.15)',
              scale: 1.03
            }
          },
          labelLine: {
            show: false
          },
          data: [
            { 
              value: 38, 
              name: '图像分类', 
              itemStyle: { 
                color: new echarts.graphic.LinearGradient(45, 0, 0, 45, [
                  { offset: 0, color: '#409eff' },
                  { offset: 1, color: '#66b1ff' }
                ])
              }
            },
            { 
              value: 25, 
              name: '目标检测', 
              itemStyle: { 
                color: new echarts.graphic.LinearGradient(45, 0, 0, 45, [
                  { offset: 0, color: '#67c23a' },
                  { offset: 1, color: '#85ce61' }
                ])
              }
            },
            { 
              value: 30, 
              name: '语义分割', 
              itemStyle: { 
                color: new echarts.graphic.LinearGradient(45, 0, 0, 45, [
                  { offset: 0, color: '#e6a23c' },
                  { offset: 1, color: '#ebb563' }
                ])
              }
            },
            { 
              value: 15, 
              name: '实例分割', 
              itemStyle: { 
                color: new echarts.graphic.LinearGradient(45, 0, 0, 45, [
                  { offset: 0, color: '#f56c6c' },
                  { offset: 1, color: '#f78989' }
                ])
              }
            }
          ],
          animationType: 'scale',
          animationEasing: 'cubicOut',
          animationDuration: 2000,
          animationDelay: function (idx) {
            return idx * 200;
          }
        }
      ]
    }
    taskTypeChart.setOption(option)
  }
}

// 监听窗口大小变化，重新调整图表大小
const handleResize = () => {
  if (taskTrendChart) {
    taskTrendChart.resize()
  }
  if (taskTypeChart) {
    taskTypeChart.resize()
  }
}

// 组件挂载时初始化图表
onMounted(() => {
  nextTick(() => {
    initTaskTrendChart()
    initTaskTypeChart()
    window.addEventListener('resize', handleResize)
  })
})

// 组件卸载时清理图表
const cleanupCharts = () => {
  if (taskTrendChart) {
    taskTrendChart.dispose()
  }
  if (taskTypeChart) {
    taskTypeChart.dispose()
  }
  window.removeEventListener('resize', handleResize)
}

// 组件卸载时调用清理函数
onUnmounted(() => {
  cleanupCharts()
})
</script>

<style scoped>
.alabel-container {
  padding: 24px;
  background-color: #f8fafc;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(64, 158, 255, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(103, 194, 58, 0.03) 0%, transparent 60%);
  background-attachment: fixed;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 0 4px;
}

.header-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.export-btn {
  padding: 10px 20px;
  border: 1px solid #409eff;
  background-color: #fff;
  color: #409eff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.export-btn:hover {
  background-color: #ecf5ff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(64, 158, 255, 0.15);
}

.create-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #409eff, #66b1ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.create-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.6s ease;
}

.create-btn:hover {
  background-color: #66b1ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(64, 158, 255, 0.3);
}

.create-btn:hover::before {
  left: 100%;
}

.header-left h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, #1e293b, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-left h1::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #409eff, #66b1ff, transparent);
  border-radius: 1.5px;
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
}

.header-left p {
  margin: 12px 0 0 0;
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
  padding: 4px;
}

.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid #f8f9fa;
  }

  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: transparent;
  }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
  }

  .stat-card:hover::before {
    transform: translateX(100%);
  }

  .stat-card::after {
    content: '';
    position: absolute;
    top: -60%;
    right: -60%;
    width: 220%;
    height: 220%;
    background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 70%);
    animation: float 8s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  .stat-card:hover::after {
    opacity: 1;
  }

  .stat-card .card-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.9;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .stat-card:hover .card-bg-decoration {
    opacity: 1;
  }

  .stat-card.primary .card-bg-decoration {
  background: linear-gradient(180deg, #409eff 0%, #66b1ff 100%);
  box-shadow: 0 0 15px rgba(64, 158, 255, 0.2);
}

.stat-card.primary {
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.stat-card.warning .card-bg-decoration {
  background: linear-gradient(180deg, #e6a23c 0%, #ebb563 100%);
  box-shadow: 0 0 15px rgba(230, 162, 60, 0.2);
}

.stat-card.warning {
  background: linear-gradient(135deg, #ffffff 0%, #fffcf0 100%);
}

.stat-card.success .card-bg-decoration {
  background: linear-gradient(180deg, #67c23a 0%, #85ce61 100%);
  box-shadow: 0 0 15px rgba(103, 194, 58, 0.2);
}

.stat-card.success {
  background: linear-gradient(135deg, #ffffff 0%, #f8fff9 100%);
}

.stat-card.info .card-bg-decoration {
  background: linear-gradient(180deg, #909399 0%, #a6a9ad 100%);
  box-shadow: 0 0 15px rgba(144, 147, 153, 0.2);
}

.stat-card.info {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

  @keyframes float {
    0% {
      transform: translate(0, 0) rotate(0deg);
    }
    50% {
      transform: translate(-15px, 15px) rotate(8deg);
    }
    100% {
      transform: translate(0, 0) rotate(0deg);
    }
  }

  .stat-content {
    position: relative;
    z-index: 1;
  }

  .stat-title {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
    transition: color 0.3s ease;
    letter-spacing: 0.02em;
  }

  .stat-card:hover .stat-title {
    color: #4b5563;
  }

  .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    letter-spacing: -0.02em;
    display: inline-block;
    position: relative;
  }

  .stat-number::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
    opacity: 0.2;
  }

  .stat-card:hover .stat-number {
    transform: translateY(-1px);
  }

  .stat-card:hover .stat-number::after {
    width: 100%;
  }

  .stat-subtitle {
    font-size: 13px;
    color: #9ca3af;
    transition: color 0.3s ease;
    font-weight: 400;
  }

  .stat-card:hover .stat-subtitle {
    color: #6b7280;
  }

.stat-icon {
  position: relative;
  z-index: 1;
}

.stat-card.primary .stat-icon {
  background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%);
  color: #409eff;
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
}

.stat-card.warning .stat-icon {
  background: linear-gradient(135deg, #fff3cd 0%, #fff9e6 100%);
  color: #e6a23c;
  box-shadow: 0 4px 12px rgba(230, 162, 60, 0.15);
}

.stat-card.success .stat-icon {
  background: linear-gradient(135deg, #d4edda 0%, #e6f7ed 100%);
  color: #67c23a;
  box-shadow: 0 4px 12px rgba(103, 194, 58, 0.15);
}

.stat-card.info .stat-icon {
  background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
  color: #909399;
  box-shadow: 0 4px 12px rgba(144, 147, 153, 0.15);
}

.stat-content .stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #1e293b, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-content .stat-title {
  font-size: 14px;
  color: #606266;
  margin-bottom: 4px;
}

.stat-content .stat-subtitle {
  font-size: 12px;
  color: #909399;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  color: #909399;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover .stat-icon {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  transform: rotate(45deg);
  transition: all 0.8s ease;
}

.stat-card:hover .stat-icon::before {
  transform: rotate(45deg) translateX(100%);
}

@media (max-width: 1200px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .charts-container {
    flex-direction: column;
  }
}

/* 图表样式 */
.charts-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
  padding: 4px;
}

.chart-card {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #f3f4f6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chart-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* 图表容器背景装饰 */
.chart-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(64, 158, 255, 0.03) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.chart-card:hover::before {
  opacity: 1;
}

.chart-card h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  position: relative;
  z-index: 1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.chart-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  background-color: #f9fafb;
  padding: 4px;
  border-radius: 8px;
}

.chart-tabs .tab {
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.chart-tabs .tab:hover {
  background-color: #f3f4f6;
  color: #6b7280;
  transform: translateY(-1px);
}

.chart-tabs .tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #409eff, #66b1ff);
  box-shadow: 0 2px 6px rgba(64, 158, 255, 0.25);
  transform: translateY(-1px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chart {
  width: 100%;
  height: 320px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1200px) {
  .charts-container {
    grid-template-columns: 1fr;
  }
}

/* 任务表格样式 */
.tasks-container {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #f3f4f6;
  padding: 28px;
  margin-bottom: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.tasks-container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(64, 158, 255, 0.03) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.tasks-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  position: relative;
  padding-left: 12px;
}

.tasks-header h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #409eff, #66b1ff);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(64, 158, 255, 0.2);
}

.view-all-btn {
  background: none;
  border: none;
  color: #409eff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.view-all-btn:hover {
  background-color: #ecf5ff;
  transform: translateY(-1px);
  text-decoration: none;
}

.tasks-table {
  width: 100%;
}

.table-header {
  display: flex;
  background: linear-gradient(90deg, #f9fafb, #f3f4f6);
  padding: 18px 0;
  font-weight: 600;
  color: #4b5563;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}

.table-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #e5e7eb, transparent);
}

.header-cell {
  text-align: left;
  padding: 0 16px;
}

.table-row {
  display: flex;
  padding: 18px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background-color: #ffffff;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.table-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.3s ease;
}

.table-row:hover {
  background: linear-gradient(90deg, #f9fafb, #ffffff);
  transform: translateX(6px) translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.1);
  border-color: #e3f2fd;
}

.table-row:hover::before {
  background: linear-gradient(180deg, #409eff, #66b1ff);
}

.table-cell {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 14px;
  color: #4b5563;
  transition: color 0.3s ease;
}

.table-row:hover .table-cell {
  color: #1f2937;
}

.task-info .task-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.task-info .task-id {
  font-size: 12px;
  color: #909399;
}

/* 任务类型标签 */
.task-type {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.task-type:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.task-type.image {
  background: linear-gradient(135deg, #ecf5ff, #f7fbff);
  color: #409eff;
  border-color: #d9ecff;
}

.task-type.target {
  background: linear-gradient(135deg, #f0f9eb, #f8fff9);
  color: #67c23a;
  border-color: #e1f3d8;
}

.task-type.semantic {
  background: linear-gradient(135deg, #fdf6ec, #fffdf0);
  color: #e6a23c;
  border-color: #fdf0d5;
}

.task-type.instance {
  background: linear-gradient(135deg, #fef0f0, #fff0f0);
  color: #f56c6c;
  border-color: #fde2e2;
}

.task-type::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.task-type.image::before {
  background-color: #409eff;
}

.task-type.target::before {
  background-color: #67c23a;
}

.task-type.semantic::before {
  background-color: #e6a23c;
}

.task-type.instance::before {
  background-color: #f56c6c;
}

/* 进度条 */
.progress-container {
  width: 100%;
  height: 12px;
  background-color: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #f9fafb, #f3f4f6);
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.progress-bar {
  background: linear-gradient(90deg, #409eff, #66b1ff);
}

.progress-bar.success {
  background: linear-gradient(90deg, #67c23a, #85ce61);
}

.progress-bar.warning {
  background: linear-gradient(90deg, #e6a23c, #ebb563);
}

.progress-bar.danger {
  background: linear-gradient(90deg, #f56c6c, #f78989);
}

.progress-text {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 状态标签 */
.status {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.status:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.status.in-progress {
  background: linear-gradient(135deg, #fdf6ec, #fffdf0);
  color: #e6a23c;
  border-color: #fdf0d5;
}

.status.completed {
  background: linear-gradient(135deg, #f0f9eb, #f8fff9);
  color: #67c23a;
  border-color: #e1f3d8;
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-dot 1.5s infinite;
}

.status.in-progress::before {
  background-color: #e6a23c;
}

.status.completed::before {
  background-color: #67c23a;
  animation: none;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 操作按钮 */
.action-buttons {
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(10px);
}

.table-row:hover .action-buttons {
  opacity: 1;
  transform: translateX(0);
}

.action-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  outline: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  transition: all 0.6s ease;
  z-index: -1;
}

.action-btn:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background-color: #ecf5ff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
  border-radius: 10px;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:active {
  transform: scale(0.96) translateY(0);
}

.action-btn.edit {
  color: #67c23a;
  border-color: #c2e7b0;
  background: linear-gradient(135deg, #f0f9eb, #f8fff9);
}

.action-btn.edit:hover {
  background: linear-gradient(135deg, #e1f3d8, #f0f9eb);
  border-color: #b3e19d;
  box-shadow: 0 3px 8px rgba(103, 194, 58, 0.15);
  color: #5daf34;
}

.action-btn.review {
  color: #e6a23c;
  border-color: #ffe8cc;
  background: linear-gradient(135deg, #fdf6ec, #fffdf0);
}

.action-btn.review:hover {
  background: linear-gradient(135deg, #fdf0d5, #fdf6ec);
  border-color: #ffd591;
  box-shadow: 0 3px 8px rgba(230, 162, 60, 0.15);
  color: #cf9236;
}

.action-btn.detail {
  color: #409eff;
  border-color: #c6e2ff;
  background: linear-gradient(135deg, #ecf5ff, #f7fbff);
}

.action-btn.detail:hover {
  background: linear-gradient(135deg, #d9ecff, #ecf5ff);
  border-color: #a0cfff;
  box-shadow: 0 3px 8px rgba(64, 158, 255, 0.25);
  color: #337ecc;
}

@media (max-width: 768px) {
  .table-header,
  .table-row {
    flex-direction: column;
  }
  
  .header-cell,
  .table-cell {
    width: 100% !important;
    padding: 8px 12px;
  }
  
  .feature-cards {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-content .stat-number {
    font-size: 24px;
  }
}

/* 功能卡片样式 */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
  padding: 4px;
}

.feature-card {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  padding: 32px 28px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  border: 1px solid #f3f4f6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
  margin-bottom: 4px;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #409eff, #66b1ff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
  border-color: #e3f2fd;
}

.feature-card:hover::before {
  transform: scaleX(1);
  box-shadow: 0 0 15px rgba(64, 158, 255, 0.3);
}

.feature-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
  font-size: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* 为不同卡片设置不同渐变背景 */
.feature-cards .feature-card:nth-child(1) .feature-icon {
  background: linear-gradient(135deg, #409eff, #66b1ff);
}

.feature-cards .feature-card:nth-child(2) .feature-icon {
  background: linear-gradient(135deg, #67c23a, #85ce61);
}

.feature-cards .feature-card:nth-child(3) .feature-icon {
  background: linear-gradient(135deg, #e6a23c, #ebb563);
}

.feature-card:hover .feature-icon {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.feature-card:hover .feature-icon::after {
  width: 100px;
  height: 100px;
}

.feature-card h4 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  transition: color 0.3s ease;
  line-height: 1.3;
}

.feature-card:hover h4 {
  color: #409eff;
}

.feature-card p {
  margin: 0 0 20px 0;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
  transition: color 0.3s ease;
}

.feature-card:hover p {
  color: #4b5563;
}

.feature-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #409eff;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.feature-btn i {
  margin-left: 6px;
  font-size: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-btn:hover {
  background-color: #ecf5ff;
}

.feature-card:hover .feature-btn i {
  transform: translateX(4px);
}

/* 添加微动画 */
@keyframes pulse {
  0% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
  100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

.feature-card:hover .feature-icon {
  animation: pulse 2s infinite;
}

@media (max-width: 1200px) {
  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
</style>